package com.neuedu.Servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class MyHttpServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("doGet method.......");
        for (int i = 0; i < 10; i++) {
            System.out.println(i);
        }
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        System.out.println("doPost method.......");
//        for (int i = 0; i < 10; i++) {
//            System.out.println(i);}

        doGet(req, resp);//将会返回上方doget方法

    }
}
